<script setup lang="ts">
import { ref, watch } from 'vue'

const totalCount = ref(10)
const msg = ref('好想玩原神！')

watch([totalCount, msg], (newValue, oldValue) => {
  console.log(newValue, oldValue)
})
</script>

<template>
  <p>{{ totalCount }}</p>
  <p>{{ msg }}</p>
  <button @click="totalCount += 2.5">点击+1坤</button>
  <button @click="msg = msg.slice(0, msg.length - 3) + '玩原神！'">点击玩原神</button>
</template>